<!DOCTYPE html>
<html>
<head>
    <meta name="viewport" content="minimum-scale=1.0, width=device-width, maximum-scale=1.0, user-scalable=no"/>
    <meta charset="utf-8">
    <title>Classes</title>
    <script src="https://unpkg.com/babel-standalone@6.15.0/babel.min.js"></script>
</head>
<body>
<h1>Classes</h1>
<p>Open the console</p>
<script type="text/babel">

    // Constructor and the prototype, the old way

    function Vacation(destination, length) {
      this.destination = destination
      this.length = length
    }

    Vacation.prototype.print = function() {
      console.log(this.destination + " will take " + this.length + " days")
    }

    var maui = new Vacation("Maui", 7)

    maui.print()

</script>
</body>
</html>
